package com.irs.controller;

import com.irs.mapper.BusinessOwnerCarMapper;
import com.irs.pojo.BuildingUtil;
import com.irs.pojo.BusinessOwnerCar;
import com.irs.util.ResultUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

@Controller
public class BusinessOwerCarController {
    @Autowired
    BusinessOwnerCarMapper businessOwnerCarDao;

    @GetMapping("build/car")//数据库中的href
    public String golist() {

        return "page/build/buildOwerCar";
    }

    @GetMapping("/build/car/list")//param接口
    @ResponseBody
    public Object villageList() {
        List<BusinessOwnerCar> businessOwnerCarList = businessOwnerCarDao.select(new BusinessOwnerCar());
        //返回JSON
        return  ResultUtil.ok(businessOwnerCarList,businessOwnerCarList.size());
    }

}
